<?php

class UpdatefeatureforeignkeyPhp extends Doctrine_Migration_Base
{
  public function up()
  {
    $this->dropForeignKey('vehicle_feature', 'vehicle_feature_vehicle_id_vehicle_id');
    $definition = array(
            'local'         => 'vehicle_id',
            'foreign'       => 'id',
            'foreignTable'  => 'vehicle',
            'onDelete'      => 'CASCADE'
    );
    $this->createForeignKey('vehicle_feature', 'vehicle_id', $definition);
    $this->dropForeignKey('vehicle_feature', 'vehicle_feature_feature_id_feature_id');
    $definition = array(
            'local'         => 'feature_id',
            'foreign'       => 'id',
            'foreignTable'  => 'feature',
            'onDelete'      => 'CASCADE'
    );
    $this->createForeignKey('vehicle_feature', 'feature_id', $definition);

  }

  }

  public function down()
  {
  }
}
